﻿using SuperMap.Desktop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SuperMap.HB.ThemeWork
{
    class PointUniqueThemeCtrlAction : CtrlAction
    {
        public PointUniqueThemeCtrlAction()
        {
        }

        public override void Run()
        {
            try
            {
                IDockBar bar = Application.ActiveApplication.MainForm.DockBarManager[typeof(SettingControl)];
                if (bar != null)
                {
                    bar.Visible = true;
                    PointThemeControl control = new PointThemeControl
                    {
                        Dock = System.Windows.Forms.DockStyle.Fill,
                        ThemeType = PointThemeType.Unique
                    };
                    bar.Control.Controls.Clear();
                    bar.Control.Controls.Add(control);
                }
            }
            catch (Exception ex)
            {
                Log.OutputBox(ex);
            }
        }
    }
}
